package contest1609;


import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int[] a = new int[100 + 10];
        int size = 0;//[0,size-1]
        while (cin.hasNext()) {
            a[size++] = cin.nextInt();
        }
        if (isSorted(a, 0, size - 1)) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }

    static boolean isSorted(int[] a, int left, int right) {
        if (left <= right)
            return true;
        for (int i = left; i + 1 <= right; i++) {
            if (a[i] > a[i + 1]) return false;
        }
        return true;
    }
}
